package com.sunxu.spring.aop;

import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;

/**
 * @author 孙许
 * @date 2018-07-13
 * @description
 */
@Aspect
public class Fighter {

    @Pointcut("execution(* com.sunxu.spring.aop.Tiger.walk())")
    public void foundTiger() {
    }

    @Before(value = "foundTiger()")
    public void foundBefore() {
        System.out.println("Fighter wait for tiger...");
    }

    @AfterReturning("foundTiger()")
    public void foundAfter() {
        System.out.println("Fighter fight with tiger...");
    }
}
